import time
import re
import collections
import math
from qqwry import QQwry
from qqwry import updateQQwry

log_file1 = "D:/k12日志分析测试/newk12_center.log"

pattern_01 = r'''"(?P<remote_addr>[^"]+)" "(?P<remote_user>[^"]+)" "(?P<time_local>[^"]+)" "(?P<request>[^"]+)" "(?P<status>[^"]+)" "(?P<body_bytes_sent>[^"]+)" "(?P<bytes_sent>[^"]+)" "(?P<http_referer>[^"]+)" "(?P<http_user_agent>[^"]+)" "(?P<http_x_forwarded_for>[^"]+)" "(?P<http_host>[^"]+)" "(?P<request_time>[^"]+)" "(?P<upstream_response_time>[^"]+)" "(?P<upstream_addr>[^"]+)" "(?P<upstream_status>[^"]+)" "(?P<myuserid>[^"]+)"'''

codes_dict = {}


def main():
    codes_dict = {
        '200': 100,
        '302': 123,
        '400': 12,
        '301': 200
    }

    codes_dict_sorted = sorted(codes_dict)
    for k in codes_dict_sorted:
        print(k, codes_dict[k])


# {'499', '302', '400', '301', '200', '206', '404', '304', '403'}
# ['499', '302', '400', '301', '200', '206', '404', '304', '403']
# ['200', '206', '301', '302', '304', '400', '403', '404', '499']

if __name__ == '__main__':
    main()
